home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / ms.h.z / ms.h
C/C++ Source or Header  |  1992-04-03  |  3KB  |  98 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *        Copyright ( C ) 1984, 1990, Silicon Graphics, Inc.      *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12. /*
  13.  * Internals for the mouse driver
  14.  *
  15.  * Most of the #define's are "mouse" dependant,
  16.  * most of the "warp" factors are not.
  17.  */
  18. #ident "$Revision: 1.5 $"
  19.  
  20. #ifdef _KERNEL
  21.  
  22. /* bits from mouse indicating button pressed */
  23. #define RGTBUTTON 0x1
  24. #define MIDBUTTON 0x2
  25. #define LFTBUTTON 0x4
  26. #define ALLBUTTONS ( LFTBUTTON | MIDBUTTON | RGTBUTTON )
  27.  
  28. /* Parameters for "Warp" */
  29. #define MOUSEMAXRAWDELTA 254 /* abs. value of the sum of two signed char's */
  30. /* defaults -- totally arbitrary, my choice */
  31. #define DEFAULTMS_MULPIPLIER 16
  32. #define DEFAULTCRVFACT 16
  33. #define DEFAULTMS_INFLECTION ( MOUSEMAXRAWDELTA / 3 )
  34. /* default acceleration == ~2.7 above 8 */
  35. #define DEFAULTMS_THRESHOLD 8
  36. #define DEFAULTMS_ACCELERATORN 8
  37. #define DEFAULTMS_ACCELERATORD 3
  38.  
  39. /* State machine states */
  40. #define MOUS_BUT_STATE 0
  41. #define MOUS_DX1_STATE 1
  42. #define MOUS_DY1_STATE 2
  43. #define MOUS_DX2_STATE 3
  44. #define MOUS_DY2_STATE 4
  45. #define MOUS_LAST_STATE 5
  46.  
  47. struct _mouse_state {
  48.     /* Actual state */
  49.     int currentX ; /* as fixed-point n.8 */
  50.     int currentY ; /* as fixed-point n.8 */
  51.     int currentButtons ;
  52.     /* Bounds - 32K to 32K - 1 */
  53.     short int minX ;
  54.     short int maxX ;
  55.     short int minY ;
  56.     short int maxY ;
  57.     /* "Warp" Variable Accelerators */
  58.     unsigned char m1 ;
  59.     unsigned char cM ;
  60.     unsigned char inflection ;
  61.     unsigned char threshold ;
  62.     unsigned short int acceleratorN ;
  63.     unsigned short int acceleratorD ;
  64.     /* Scratch Intra-report Data */
  65.     int state ;
  66.     signed char report[MOUS_LAST_STATE] ;
  67.     /* Stuff to play by the shmiq rules */
  68.     struct shmiqlinkid shmiqid ;
  69.     /* Misc. Std. Driver stuff */
  70.     unsigned int inited :1 ;
  71.     struct queue *rq ;
  72. } ;
  73.  
  74. /* No good excuse for any of the rest of this */
  75. #define DEFAULT_MS_MINX 0
  76. #define DEFAULT_MS_MINY 0
  77. #define DEFAULT_MS_MAXX 1280
  78. #define DEFAULT_MS_MAXY 1024
  79. #endif /* _KERNEL */
  80.  
  81. struct mscntl {
  82.     unsigned short int numerator ;
  83.     unsigned short int denominator ;
  84.     unsigned short int threshold ;
  85. #define MS_GETCNTL 1
  86. #define MS_SETCNTL 2
  87. #define MS_DOTHRESHOLD 4
  88. #define MS_DOACCELERATION 8
  89.     unsigned short int flags ;
  90. } ;
  91.  
  92. struct mssetpos {
  93.     unsigned short int x ;
  94.     unsigned short int y ;
  95. } ;
  96. #define MSIOCNTL _IOWR('M',147,struct mscntl)
  97. #define MSIOSETPOS _IOWR('M',149,struct mssetpos)
  98.